import { INCREMENT, DECREMENT } from '../constants'
const initNum = 0;
export default function countReducer(preState = initNum, e) {
  const { type, data } = e
  switch (type) {
    case INCREMENT:
      return preState + data
    case DECREMENT:
      return preState - data
    default:
      return preState
  }
}

